package com.jxwifi.cloud.quickcleanserver.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;

import com.amap.api.maps.model.LatLng;

import java.net.URISyntaxException;

/**
 * 
 * @date 2015年12月10日
 */
public class ToGaode implements INavigation {

	protected String mShopName;

	public ToGaode(String mShopName){
		super();
		this.mShopName=mShopName;
	}

	public void startAutonavi(Context context, String lng, String lat) {
		if (TextUtils.isEmpty(lng) || TextUtils.isEmpty(lat))
			return;
		StringBuffer stringBuffer = new StringBuffer("androidamap://navi?sourceApplication=").append("amap");
		stringBuffer.append("&lat=").append(lat)
				.append("&lon=").append(lng).append("&keywords=" + mShopName)
				.append("&dev=").append(0)
				.append("&style=").append(2);
		Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(stringBuffer.toString()));
		intent.setPackage("com.autonavi.minimap");
		context.startActivity(intent);

	}
}
